import Vue from 'vue'
import VueRouter from 'vue-router'
import MovieView from '../views/MovieView.vue'
import ReYing from '../views/ReYing.vue'
import DaiYing from '../views/DaiYing.vue'
import VidoView from '../views/VidoView.vue'
import PengView from '../views/PengView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '/',
    component: MovieView,
    children:[
      {
        path:'reying',
        name:'/reying',
        component: ReYing,
      },
      {
        path:'daiying',
        name:'/daiying',
        component:  DaiYing,
      },
    ]
  },
 

  {
    path: '/vido',
    name: 'vido',
    component: VidoView,
  },
  {
    path: '/user',
    name: 'user',
    component: () => import( '../views/UserView.vue'),
  },

  {
    path: '/moviedetail',
    name: 'moviedetail',
    component: () => import( '../views/MovieDetail.vue'),
  },

  {
    path: '/wishview',
    name: 'wishview',
    component: () => import( '../views/WishView.vue'),
  },

  {
    path:'/login',
    name: 'login',
    component: () => import('../views/login')
  },

  {
    path:'/register',
    name: 'register',
    component: () => import('../views/register')
  },

  {
    path:'/Peng',
    name: 'peng',
    component: PengView
  },

  {
    path:'/MovieDetail/:id',
    name: 'MovieDetail',
    props:true,
    component: () => import('../views/MovieDetail')
  },

  {
    path:'/wishview/:id',
    name: 'wishview',
    props:true,
    component: () => import('../views/WishView')
  },

  {
    path:'/SerchIndex',
    name: 'SerchIndex',
    component: () => import('../views/SerchIndex')
  },
  
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
});

export default router;
